package com.jkt.rms.business.base;

import java.lang.Comparable;
import java.io.Serializable;


/**
 * This is an object that contains data related to the authorities table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="authorities"
 */

@SuppressWarnings("serial")
public abstract class BaseAuthorities  implements Comparable, Serializable {

	public static String REF = "Authorities";
	public static String PROP_AUTHORITY = "authority";
	public static String PROP_USERNAME = "username";
	public static String PROP_AUTHORITIES_ID = "authorityId";


	// constructors
	public BaseAuthorities () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseAuthorities (int authorityId) {
		this.setAuthorityId(authorityId);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseAuthorities (
		int authorityId,
		java.lang.String username,
		java.lang.String authority) {

		this.setAuthorityId(authorityId);
		this.setUsername(username);
		this.setAuthority(authority);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private int authorityId;

	// fields
	private java.lang.String username;
	private java.lang.String authority;



	




	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: authority
	 */
	public java.lang.String getAuthority () {
		return authority;
	}

	/**
	 * Set the value related to the column: authority
	 * @param authority the authority value
	 */
	public void setAuthority (java.lang.String authority) {
		this.authority = authority;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jkt.rms.business.Authorities)) return false;
		else {
			com.jkt.rms.business.Authorities authorities = (com.jkt.rms.business.Authorities) obj;
			return (this.getAuthorityId() == authorities.getAuthorityId());
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			return (int) this.getAuthorityId();
		}
		return this.hashCode;
	}

	public int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

	public String toString () {
		return super.toString();
	}

	public int getAuthorityId() {
		return authorityId;
	}

	public void setAuthorityId(int authorityId) {
		this.authorityId = authorityId;
	}


}